package com.ffyc.backserver.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/*
@ConfigurationProperties(prefix = "user")*/

@Component//让sping扫描
public class Admin {
    private Integer id;
    private String account;
    private String password;
    private String token;
    private Integer type;

   /* @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")*/
   @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
   private Date birthday;
    private String  address;
    private String phone;
    private String newImgname;
    private String oldFileName;
    private List<Role> roles;
    private String sex;
    private Integer pageNum;
    private Integer pageSize;
    private Integer[] RoleId;

    public String getOldFileName() {
        return oldFileName;
    }

    public void setOldFileName(String oldFileName) {
        this.oldFileName = oldFileName;
    }

    public Integer[] getRoleId() {
        return RoleId;
    }

    public void setRoleId(Integer[] roleId) {
        RoleId = roleId;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNewImgname() {
        return newImgname;
    }


    public void setNewImgname(String newImgname) {
        this.newImgname = newImgname;
    }

/*
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
*/
    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "account='" + account + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
